package com.avhdeveloper.actions;

import com.opensymphony.xwork2.ActionSupport;



public class Delay extends ActionSupport{
  
  private static final long serialVersionUID = 1L;
  private int nrOfSeconds;

  public void setNrOfSeconds(int nrOfSeconds) {
    this.nrOfSeconds = nrOfSeconds;
  }

  public int getNrOfSeconds() {
    return nrOfSeconds;
  }
  
  
  public String execute(){
    System.out.println("Will wait for " + nrOfSeconds + " seconds.");
    try {
      Thread.currentThread().sleep(nrOfSeconds * 1000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    return SUCCESS;
  }
  

}
